package com.example.design.proxy.demo1;

/**
 * 测试代理模式-----
 */
public class UserTest {
    public static void main(String[] args) {
        UserDao userDao=new UserDaoImp(); //生成原始对象

        UserProxyImp userProxyImp=new UserProxyImp(userDao);

        int res = userProxyImp.add(100, 20);
        System.out.println("相加的结果是："+res);
        System.out.println("===========");
        int sub = userProxyImp.sub(100, 50);
        System.out.println("相减的结果是:"+sub);
    }
}
